<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>药品信息查看</title>
    <%@include file="/WEB-INF/jsp/header.jsp"%>

</head>
<style>
    table td{
        font: 14px 'microsoft yahei', 微软雅黑, Helvetica, Arial, Tahoma, 黑体, 宋体, sans-serif;
    }
</style>
<body>
    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading">
                <span class="h3">搜索</span>
                <a href=".panel-body" class="caret pull-right" data-toggle="collapse"></a>
            </div>
            <div class="panel-body collapse in fade">
                <form id="con" class="pull-left form-inline">
                    <label>药品编号：</label>
                    <input class="form-control" type="text" name="drugNum" oninput="search()" placeholder="请输入药品编号" value="${param.condition.drugNum}">
                    &nbsp;&nbsp;
                    <label>药品名称：</label>
                    <input class="form-control" type="text" name="drugName" oninput="search()" placeholder="请输入药品名称" value="${param.condition.drugName}">
                    &nbsp;&nbsp;
                    <label>药品分类：</label>
                    <div class="form-group">
                        <select class="form-control col-md-12" name="typeNum" oninput="search()" id="xia">
                            <option value="">--请选择--</option>
                        </select>
                    </div>
                    &nbsp;
                    <button type="button" onclick="search()" class="layui-btn layui-btn-small">
                        <i class="layui-icon"></i> 搜索
                    </button>
                </form>
            </div>
            <blockquote class="layui-elem-quote">
                <button type="button" class="layui-btn layui-btn-small" id="add" onclick="addDrug()">
                    <i class="layui-icon"></i> 添加药品信息
                </button>
                <button type="button" onclick="batchDel()" class="layui-btn layui-btn-danger layui-btn-small" id="batchDel">
                    <i class="layui-icon"></i> 批量删除
                </button>
            </blockquote>
            <table id="drugTable"
                   data-pagination-pre-text="上一页"
                   data-pagination-next-text="下一页"
                   data-click-to-select="true"
                   data-toggle="table"
                   data-url="${ctx}/drug/search"
                   data-striped="true"
                   data-toolbar="#toolbar"
                   data-toolbar-align="right"
                   data-pagination="true"
                   data-side-pagination="server"
                   data-page-size="10"
            >
                <thead>
                <tr>
                    <th data-checkbox="true"></th>
                    <th data-field="drugId">序号</th>
                    <th data-field="drugNum">编号</th>
                    <th data-field="drugName">药品名称</th>
                    <th data-field="drugStandard">规格</th>
                    <th data-field="drugPreparation">剂型</th>
                    <th data-field="drugUnit">单位</th>
                    <th data-field="drugWarranty">保质期(月)</th>
                    <th data-field="drugFloor">库存下限</th>
                    <th data-field="drugtype.typeName">分类名称</th>
                    <th data-formatter="caozuo" data-events="optEvents">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div id="addDrug">

        </div>
        <div id="updateDrug">

        </div>
        <div class="myForm" style="display: none;">
            <form class="form-horizontal">
                <input type="hidden" name="drugNum" value=""/>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品名称：</label>
                    <div class="form-group col-md-5">
                        <input onfocus="clearN(this)" onblur="checkName()"  type="text" name="drugName" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkName"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品规格：</label>
                    <div class="form-group col-md-4">
                        <input onfocus="clearN(this)" onblur="checkStandard()" type="text" name="drugStandard" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkStandard"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品单位：</label>
                    <div class="form-group col-md-4">
                        <input onfocus="clearN(this)" onblur="checkUnit()" type="text" name="drugUnit" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkUnit"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品剂型：</label>
                    <div class="form-group col-md-4">
                        <input onfocus="clearN(this)" onblur="checkPreparation()" type="text" name="drugPreparation" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkPreparation"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">质保期(月)：</label>
                    <div class="form-group col-md-4">
                        <input onfocus="clearN(this)" onblur="checkWarranty()" type="text" name="drugWarranty" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkWarranty"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">库存下限：</label>
                    <div class="form-group col-md-4">
                        <input onfocus="clearN(this)" onblur="checkstoFloor()" type="text" name="drugFloor" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkstoFloor"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品类型：</label>
                    <div class="form-group col-md-5">
                        <select oninput="checktypeNum(this.value)" name="typeNum" id="sel" class="form-control">
                            <option value="-1">--请选择--</option>
                        </select>
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checktypeNum"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">备注：</label>
                    <div class="form-group col-md-6">
                        <textarea name="drugRemark" class="form-control"></textarea>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <%@include file="/WEB-INF/jsp/footer.jsp"%>
    <script src="${ctx}/res/js/Druginfo.js"></script>

</body>
</html>
